package org.fastsyncer.common.entity;

import java.io.Serializable;
import java.util.List;
import java.util.Map;

/**
 * @ClassName: DatabaseConfig 
 * @Description: 数据库连接配置
 * @author AE86
 * @date: 2017年7月20日 下午3:40:59
 */
public class DatabaseConfig implements Serializable {

	private static final long serialVersionUID = 1768242426510437724L;
	
	// 驱动com.mysql.jdbc.Driver
	private String driverClassName;

	// 连接地址jdbc:mysql://127.0.0.1:3306/test?seUnicode=true&characterEncoding=UTF8&useSSL=true
	private String url;

	// 表名
	private String table;

	// 主键
	private String primaryKey;

	// 帐号
	private String username;

	// 密码
	private String password;
	
	// 通过SQL获取表信息
	private String sql;

	// 表包含的字段
	private List<Map<String, Object>> column;

	public DatabaseConfig() {
		super();
	}

	public DatabaseConfig(String driverClassName, String url, String table, String primaryKey, String username, String password, String sql) {
		super();
		this.driverClassName = driverClassName;
		this.url = url;
		this.table = table;
		this.primaryKey = primaryKey;
		this.username = username;
		this.password = password;
		this.sql = sql;
	}

	public String getTable() {
		return table;
	}

	public DatabaseConfig setTable(String table) {
		this.table = table;
        return this;
	}

	public String getPrimaryKey() {
		return primaryKey;
	}

	public DatabaseConfig setPrimaryKey(String primaryKey) {
		this.primaryKey = primaryKey;
        return this;
	}

	public String getDriverClassName() {
		return driverClassName;
	}

	public DatabaseConfig setDriverClassName(String driverClassName) {
		this.driverClassName = driverClassName;
        return this;
	}

	public String getUrl() {
		return url;
	}

	public DatabaseConfig setUrl(String url) {
		this.url = url;
        return this;
	}

	public String getUsername() {
		return username;
	}

	public DatabaseConfig setUsername(String username) {
		this.username = username;
        return this;
	}

	public String getPassword() {
		return password;
	}

	public DatabaseConfig setPassword(String password) {
		this.password = password;
        return this;
	}

	public String getSql() {
        return sql;
    }

    public void setSql(String sql) {
        this.sql = sql;
    }

    public List<Map<String, Object>> getColumn() {
		return column;
	}

	public DatabaseConfig setColumn(List<Map<String, Object>> column) {
		this.column = column;
        return this;
	}

}
